<?php
echo extension_loaded('pgsql') ? 'yes':'no';
$dbconn = pg_connect("host=localhost port=5432 dbname=blog user=postgres password=root")
   or die("Could not connect");
echo "Connected successfully";
pg_close($dbconn);
?>